{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
{echo:JS::import('form');}
{echo:JS::import('date');}
<style type="text/css">
    #table_option td{
        width: 8px;
        height: 8px;
        background: #ddd;
        border:1px #999 solid;
        cursor: pointer;
    }
</style>
<h1 class="page_title">{$title}</h1>
<form action="{url:/app/goods_slide_save}" method="post" id="appForm" enctype="multipart/form-data">
<div id="obj_form" class="form2">


        <dl class="lineD">
        <dt>图片：</dt>
        <dd>
        	{if:$obj['id'] == null}
        		<input type="file" name="upImg" id="upImg" class="big"/>  
        	{else:}
        		<img src="{$domain}{$obj['content']}" width="400" height="auto"/>
        	{/if}
          	        
        </dd>
        </dl>
        {if:$obj['id'] != null}
        <dl class="lineD">
        <dt> 替换图片：</dt>
        <dd>
          <input type="file" name="upsImg" id="upsImg"/>
        </dd>
        </dl>
        {/if}
		<dl class="lineD">
        <dt> 顺序：</dt>
        <dd>
          <input type="text" id="order" name="order" value="{$obj['order']|'0'}" class="big" pattern="\d*"  alt="顺序不能为空且必须为数字！" >
        </dd>
        </dl>
        
        <!-- 
        <dl class="lineD">
        <dt> 关联新闻：</dt>
        <dd>
          <input type="text" id="link" name="link" value="{$obj['link']}" class="big" pattern="required"  alt="关联不能为空！" readonly="readonly">
          <a href="javascript:;" onclick="goods_select('link')" class="button">选择新闻 ...</a>
        </dd>
        </dl>
        -->
        <!-- 
        <dl class="lineD">
        <dt>是否显示：</dt>
        <dd>
          <select name="is_open">
          	{if: $obj['is_open'] == '0'}
          		<option value="0" selected="selected">否</option>
          		<option value="1">是</option>
          	{else:}
          		<option value="0" >否</option>
          		<option value="1" selected="selected">是</option>
          	{/if}
          </select>
        </dd>
        </dl>
        -->
        
        
        <dl class="lineD">
        <dt> 选择商家：</dt>
        <dd>
            <select name="seller_id">
            	{query:name=user where=u_lx eq 2}
            	<option value="{$item[id]}">{$item['name']}</option>
            	{/query}
            </select>
        </dd>
        </dl>
        
        
        <!-- 
        <dl class="lineD">
        <dt>版本描述：</dt>
        <dd>
          <textarea name="introduct" >{$obj['introduct']}</textarea>
          <label></label>
        </dd>
        </dl>
         --> 
      </div>
      <input type="hidden" name="id" value="{$obj['id']}"/>
      <!--活动描述 end-->
      <div style="text-align:center"><input onclick="return check();" type="submit" value="提交" class="button">&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重置" class="button"></div>
</form>
<script type="text/javascript">

function goods_select(gid)
{
  art.dialog.open('{url:/app/radio_news_select?gid='+gid+'}',{id:'goods_select',title:'选择新闻：',width:900,height:500,padding:'10px'});
}
/*
function news_select(gid)
{
  art.dialog.open('{url:/app/radio_news_select?gid='+gid+'}',{id:'news_select',title:'选择新闻：',width:900,height:500,padding:'10px'});
}
*/
function check()
{
	
	if($("#upImg").val() == "")
	{
		$(".invalid-msg").remove();
		//alert("图片不能为空");
		$("#upImg").after("<label class='invalid-msg'>图片不能为空</label>");
		return false;
	}
	else
	{
		$("#upImg").next().remove();
	}
}
$("#table_option td:eq({$contents[0]['position']})").css("background","#000");
</script>